package com.tedu.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * Author：毕龙
 * Date: 2022/9/15 15:47
 * 是web前端和后端交互的对象
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class SysResult implements Serializable {
    private Integer status;// 200 成功 201失败
    private String msg;//提示信息
    private Object data; //服务器返回的数据

    public static SysResult fail(){
        return new SysResult(201,"业务调用失败!!!",null);
    }

    public static SysResult success(){
        return new SysResult(200,"业务调用成功!!!",null);
    }

    public static SysResult success(Object data){
        return new SysResult(200,"业务调用成功!!!",data);
    }

    public static SysResult success(String msg,Object data){
        return new SysResult(200,msg,data);
    }

}
